package org.keyuan.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.keyuan.dao.OrderDao;
import org.keyuan.entity.Buyer;
import org.keyuan.entity.Order;
import org.keyuan.entity.OrderDeliverInfo;

public class OrderDaoImpl extends DaoSupport<Order> implements OrderDao{
	@SuppressWarnings("unchecked")
	@Override
	public List<OrderDeliverInfo> getDeliverInfos(Buyer buer) {
		
		String hql="from OrderDeliverInfo o where buyer=? order by o.createDate desc";
		Query query=this.getSession().createQuery(hql);
		query.setParameter(0, buer);
		List<OrderDeliverInfo> buyers=query.list();
		return buyers;
	}
}
